<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
	</head>
	<body>
	</body>
	<script>
		setTimeout(function(){
		    console.log('定时器开始啦')
		});
		
		new Promise(function(resolve){
		    console.log('马上执行for循环啦');
		    for(var i = 0; i < 10000; i++){
		        i == 99 && resolve();
		    }
		}).then(function(){
		    console.log('执行then-1函数啦')
		}).then(function(){
		    console.log('执行then-2函数啦')
		}).then(function(){
		    console.log('执行then-3函数啦')
		});

		Promise.resolve().then(() => {
		    console.log('执行then-4函数啦')
		}).then(() => {
		    console.log('执行then-5函数啦')
		})
		
		console.log('代码执行结束');

		// async function async1() {
        //     console.log('async1 start');
        //     await async2();
        //     console.log('async1 end')
        // }
        // async function async2() {
        //     console.log('async2')
        // }
        // console.log('script start');
        // async1();
        // console.log('script end')
	
	</script>
</html>
